<?php
namespace app\admin\controller;

use app\common\cache\bank\IBankCache;
use app\common\controller\AdminBaseController;
use app\common\ext\IDb;
use app\common\ext\IRequest;

class UserCreditCard extends AdminBaseController{

    /**
     * @功能：用户信用卡信息
     * @开发者：cxl
     * @return string
     */
    public function user_credit_card_list(){
        //接收参数
        $user_id = IRequest::get('user_id');
        $bank_id = IRequest::get('bank_id');

        //取得代理商数据
        $bank_list = IBankCache::getList();

        //设置查询条件
        $where = null;
        if(!empty($user_id)) $where['user_id'] = $user_id;
        if(!empty($bank_id)) $where['bank_id'] = $bank_id;
        $user_credit_card_list = IDb::getInstance('asset_credit_card')->setDbWhere($where)->setDbOrder("user_credit_card_id")->pag();

        //页面赋值
        $this->assign("user_id",$user_id);
        $this->assign("bank_id",$bank_id);
        $this->assign("bank_list",$bank_list);
        $this->assign("user_credit_card_list",$user_credit_card_list);

        //渲染模板输出
        return view();
    }
}
